@extends('web.layouts.app')

@section('styles')
    <link rel="stylesheet" type="text/css" href="{{ asset('resources/web/css/index.css') }}">
    <link rel="stylesheet" type="text/css" href="{{ asset('resources/web/css/ucenter.css')}}">
@endsection

@section('content')
<div class="uc-wrap swrap mt20">
    <div class="uc-side L">
        <div class="uc-nav">
            <ul>
                @include('web.user_center.menu')
            </ul>
        </div>
    </div>
    <div class="uc-main uc-mainbg R">
        <!--担保管理查询表单-->
        <div class="user-time-search ml20">
            <form action="" method="get">
                <div class="letter">
                    <label>合同编号 <input type="text" class="txt" name="sn" value="{{$find['sn']??''}}"></label>
                    <label>
                        合同状态 
                        <div class="select">
                            <select name="status">
                                <option value="">请选择</option>
                                @foreach($status as $item)
                                <option value="{{$item->code}}" {{isset($find['status']) && $item->code==$find['status']?'selected':''}}>{{$item->name}}</option>
                                @endforeach
                            </select>
                        </div>
                    </label>
                </div>
                <span>起止日期</span>
                <input type="text" class="date-txt" name="begin_time" value="{{$find['begin_time']??''}}" onclick="WdatePicker();"> - <input type="text" class="date-txt" name="end_time" value="{{$find['end_time']??''}}" onclick="WdatePicker();">
                <input type="submit" class="btn" value="搜索">
            </form>
        </div>
        <!--融资列表-->
        <div class="user-item-list">
            <ul class="data-list danbao-list">
                <li class="th">
                    <div class="col-create-date">创建时间</div>
                    <div class="col-letter-name">项目名</div>
                    <div class="col-letter-no">合同编号</div> 
                    <div class="col-dbf">担保费</div>
                    <div class="col-status">状态</div>
                    <div class="col-do">操作</div>
                </li>
                @forelse($list as $item)
                <li>
                    <div class="col-create-date">{{$item->created_at}}</div>
                    <div class="col-letter-no">
                        <span>{{$item->projects_name}}</span>
                    </div>
                    <div class="col-letter-name"> {{$item->collateral_licence_no}}
                            <a class="blue" href="{{ action('UserCenter\UserCenterController@printTemplate',[$item->id]) }}" target="_bank">打印</a></div>
                    <div class="col-dbf">0.0</div>
                    <div class="col-status">{{$item->status()->name}}</div>
                    <div class="col-do"><a class="orange" href="/guarantee/check/{{$item->id}}">详情</a></div>
                </li>
                @empty
                <li>无相关记录</li>
                @endforelse
            </ul>
            {{$links}}
        </div>
    </div>
</div>
@endsection

@section('scripts')
    <script src="{{ asset('resources/web/js/index.js') }}"></script>
    <script type="text/javascript" src="{{ asset('resources/web/plugins/datePicker/WdatePicker.js') }}"></script>
@endsection